//<div class="public-pop-appd"><a href="javascript:;" title="下载寻求医健康医生手机客户端" target="_blank"><span class="public-pop-rp">手机更方便，随时随地问医生</span></a></div>\
jQuery(function(){
    ({
    options: {
        width: 328, //弹框宽度
        height:188, //弹框高度
        time: 10000, //自动隐藏时间, 默认3分钟
        animTime: 300 //动画时间
    },
    html:'',
    timer: null,
    init: function(){
		var nowUrl = window.location.href;        
        if(true)
		{
		   this.append(); //插入html
		   this.popInit(); //初次加载弹框
		   this.popSwap(); //大小弹框相互交换
		}
    },
    append: function(){
		jQuery('body').append(this.html);
    },
 
    popInit: function(){
        var self = this;
        jQuery('.public-pop').bind({
            mouseover: function(){
                clearTimeout(self.timer);
            },
            mouseout: function(){
                self.popAuto();
            }
        });
        jQuery('.public-pop').animate({height: this.options.height}, this.options.animTime, function(){jQuery('.public-pop').css('overflow', 'visible');});
        this.popAuto();
    },
    popAuto: function(){
        var self = this;
        clearTimeout(self.timer);
        this.timer = setTimeout(function(){
            self.anim();
        }, this.options.time);
    },
    popSwap: function(){
        var self = this;
        jQuery('.public-pop-close').click(function(){
            clearTimeout(self.timer);
            self.anim();
        });
        jQuery('.public-pop-x').click(function(event){
            var mySelf = jQuery(this);
            clearTimeout(self.timer);
           if(jQuery(event.target).hasClass('public-pop-xclose')){
               mySelf.animate({width:0, height:0}, self.options.animTime, function(){
                    mySelf.hide();
               });
           }
           else{
                mySelf.fadeOut(self.options.animTime);                
                jQuery('.public-pop').show().animate({width: self.options.width, height: self.options.height}, self.options.animTime, function(){jQuery('.public-pop').css('overflow', 'visible');});
                self.popAuto();
           }
        });
    },
    anim: function(){
        var self = this;
        jQuery('.public-pop').animate({width:0, height:0}, this.options.animTime, function(){
           jQuery(this).hide();
           jQuery('.public-pop-x').fadeIn(self.options.animTime); 
        });
    }
  }).init();
})